import { doTinyCompress } from "../tinypng";
import { join } from 'path';
import { KeeperService } from "../lib/Keeper";

async function start() {
    let picSrc = join(process.cwd(), 'test');
    let picDst = join(process.cwd(), 'test', '__tinypng__');
    let sqlitePath = join(process.cwd(), 'test', '__tinypng__', 'image.db');
    let ApiKeys = ['KD3QrDKGRbp0CdbcJcpSWSQCCSZVvl7Z'];
    await KeeperService.init(ApiKeys, 'sqlite', sqlitePath)
    // await KeeperService.init(ApiKeys, 'mongo', "10.0.0.10","27017","tinypng")
    await doTinyCompress(picSrc, picDst)
    console.log('finish');
    process.exit(0);
}

start();